Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #325 #332

Merged
merged 21 commits into from
Dec 27, 2017
Merged

Fixed #325 #332

merged 21 commits into from
Dec 27, 2017

Conversation

lk-geimfari
Copy link
Owner

@lk-geimfari lk-geimfari commented Dec 21, 2017

No description provided.

@lk-geimfari lk-geimfari changed the title Added support of seed for enums [WIP] Added support of seed for enums Dec 21, 2017
@lk-geimfari lk-geimfari added the bug Unexpected behaviour and bugs label Dec 21, 2017
Repository owner deleted a comment from codecov bot Dec 21, 2017
:return: Random item of enum.
"""
if seed is not None:
random.seed(seed)
Copy link
Contributor

@duckyou duckyou Dec 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lk-geimfari heres we have some issue. When we call this function with specific seed, it always be return same value.

>>> import random
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4

Why we cant just pass random object instance?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duckyou We can do it. I just thought that we can do it with a minimum of changes. Create a branch from this branch with your changes, please.

duckyou and others added 7 commits December 22, 2017 14:23
* Redesign Base providers. Now for date providers we have BaseDataProvider and super class BaseProvider
* BaseSpecProvider have superclass BaseProvider
* BaseProvider contains seed and random object
* Fixed spec provider seed issues
* Redesigned base providers.
* Added superclass BaseProvider for BaseSpecProvider
* BaseProvider contains seed and random object
* Fixed generic provider for seed support
@lk-geimfari lk-geimfari removed the bug Unexpected behaviour and bugs label Dec 26, 2017
Repository owner deleted a comment from codecov bot Dec 26, 2017
Repository owner deleted a comment from codecov bot Dec 26, 2017
@codecov
Copy link

codecov bot commented Dec 26, 2017

Codecov Report

Merging #332 into master will decrease coverage by 0.17%.
The diff coverage is 99.15%.

@@            Coverage Diff             @@
##           master     #332      +/-   ##
==========================================
- Coverage   98.83%   98.65%   -0.18%     
==========================================
  Files          58       58              
  Lines        1627     1634       +7     
==========================================
+ Hits         1608     1612       +4     
- Misses         19       22       +3

@lk-geimfari lk-geimfari changed the title [WIP] Added support of seed for enums Fixed #325 Dec 26, 2017
@lk-geimfari lk-geimfari merged commit 1e301d0 into master Dec 27, 2017
@lk-geimfari lk-geimfari deleted the enabled_seed_enum branch January 20, 2018 14:31
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.

2 participants