Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse random.seed for deterministic doctest outputs #315
Conversation
Codecov Report
@@ Coverage Diff @@
## master #315 +/- ##
==========================================
+ Coverage 36.49% 36.83% +0.33%
==========================================
Files 38 38
Lines 1307 1276 -31
==========================================
- Hits 477 470 -7
+ Misses 830 806 -24
Continue to review full report at Codecov.
|
This PR was intended to add doctest for
blackboard.py.As a workaround for
randomoutputs -random.seedwas used.random.seed(1234)if you should run script by hand likepython patterns/other/blackboard.pypytest-randomlyplugin to run viapytestI've added related comments to
tox.inibut need to explain a bit futher:For unittest part - plugin is disabled not because of
random.*outputs, but because plugin shuffles order of tests and it has found another issue (some tests depend on their order). I haven't investigated it further for the moment, will do it a bit later.Please let me know if someone has simpler way of testing with
random.*or sees problems with current approach.p.s. there is another script with use of random -
abstract_factory. And so I can fix it after.