Skip to content

Conversation

@gyermolenko
Copy link
Contributor

@gyermolenko gyermolenko commented Nov 11, 2019

This PR was intended to add doctest for blackboard.py.
As a workaround for random outputs - random.seed was used.

  • random.seed(1234) if you should run script by hand like python patterns/other/blackboard.py
  • pytest-randomly plugin to run via pytest

I've added related comments to tox.ini but 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.

@codecov-io
Copy link

Codecov Report

Merging #315 into master will increase coverage by 0.33%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
patterns/other/blackboard.py 0% <0%> (ø) ⬆️
patterns/creational/lazy_evaluation.py 90.9% <0%> (-0.76%) ⬇️
patterns/behavioral/observer.py 88.57% <0%> (-0.62%) ⬇️
patterns/behavioral/specification.py 83.05% <0%> (-0.56%) ⬇️
patterns/structural/mvc.py 0% <0%> (ø) ⬆️
patterns/structural/flyweight_with_metaclass.py 0% <0%> (ø) ⬆️
patterns/behavioral/catalog.py 0% <0%> (ø) ⬆️
patterns/behavioral/memento.py 0% <0%> (ø) ⬆️
patterns/behavioral/registry.py 0% <0%> (ø) ⬆️
patterns/behavioral/chain_of_responsibility.py 0% <0%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1af2089...669818d. Read the comment docs.

@faif faif merged commit 7bc5aec into faif:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants