Commit Graph

9 Commits

Author SHA1 Message Date
Eric Jolibois 7cc8d254e9 disable hypothesis health check to avoid false negative (#2389) 2021-02-23 00:44:28 +01:00
Samuel Colvin 1ee9737cf5 make hypothesis optional for testing (#2343)
* make hypothesis optional for testing

* fix coveragin in "_hypothesis_plugin.py"

* uncomment ci checks
2021-02-12 10:46:34 +00:00
Zac Hatfield-Dodds 771b0d3d92 Add a Hypothesis plugin (#2097)
* Configure Hypothesis

* Hypothesis plugin docs

* Add Hypothesis plugin

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-11 12:33:11 +00:00
Eric Jolibois 3496a473c7 build(deps): bump to pytest 6.2.1, pytest-mock 3.4.0, mkdocs-material 6.1.7 and codecov-action v1.0.15 (#2201)
* build(deps): bump to pytest 6.2.1, pytest-mock 3.4.0, mkdocs-material 6.1.7 and codecov-action v1.0.15

replaces #2199, #2180 and #2164

* fix: yield_fixture is deprecated

* chore: add dotenv in optional deps
2020-12-17 23:28:07 +01:00
Arseny Boykov 44b639951b add pytest assert rewrite to create_module, rewrite existing tests (#2035) 2020-10-26 10:12:49 +00:00
Arseny Boykov 6b53cabe03 Add pickle support to dynamically created models and generics (#1686)
* Add pickle support to dynamically created models

* Add created model module check

* Use globals() to retrieve model

* Use single quotes

* use mocker instead of mock

Co-authored-by: PrettyWood <em.jolibois@gmail.com>

* remove unused import

* add test for dynamic forward ref

* move generic test to test_generics.py

* fix test_generic_model_pickle test, add additional check for <locals> in create_model

* fix code style

* resolve issues with global/local models

* make ensure_picklable return given model

* remove ensure_picklable, use test_is_call_from_module only in generics

* reformat code after updating black==20.8b1

* move get_caller_module_name and is_call_from_module to generics

* apply suggestions from @samuelcolvin

* add tests for get_caller_module and is_call_from_module called from module

* fix linting

* fix path to modules in test_module fixture, capture stderr and stdout

* fix broken test module

* fix subprocess call for windows

* enhance create_module fixture, add run_as_module fixture

this will allow run modules in subprocess and define module code in functions-containers

* add test for redefined concrete model without cache

* add changes file

* remove unused variable

* rewrite tests with pytest.raises

* fix linting

* rewrite test_create_model_pickle and test_forward_ref_with_create_model with module definition in function

* Update create_model docstring

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-18 20:55:44 +01:00
Samuel Colvin 25b5d98030 support postponed annotations and ForwardRef in python 3.7 (#348)
* support postponed annotations in python 3.7

* support for full ForwardRef

* tweak update_forward_refs

* better ForwardRef resolution

* remove debug, fix linting

* fix comments

* docs and history
2019-01-11 21:01:07 +00:00
Samuel Colvin 45cba8b1ae fixing isort, adding deploy recipe 2017-06-03 16:18:02 +01:00
Samuel Colvin 003c0a747b adding basic tests 2017-05-05 13:34:59 +01:00