Closed drewbrew closed 5 years ago
I'm not sure that I follow the reason for this. Under the existing method, each character in the result is one of 968 (1000-32) possible unicode characters (str in py3). A length of 20 would generate 19,360 unique combinations; a length of 36 would generate 34,848. UUIDs contain 16 unique characters, all of which are simple ASCII, and the lengths above would generate 320 and 576 combinations, respectively.
How is this increasing randomness? And it would also seem that you are losing what this method is designed to do, namely provide non-ASCII strings.
I'm not intending to increase randomness at all. Most if not all of these tests don't need random data.
However, after looking at the CI flakiness, it's almost entirely focused on one test. I think I'm trying to kill a mole with a sledgehammer. Let me try something.
@EdLeafe take a look at the revised PR when you get a chance, please.
So the issue was the presence of a hyphen? If so, this seems much cleaner.
It appears that way anyway. If more tests randomly fail, there are always more PRs.
BTW, it's good to see people working to maintain pyrax until there is a path forward. I personally promised so many developers that it would always be supported, and for a while there it looked more like abandonware.
I think if we need to do random value testing we should look at testing with something like QuickCheck.
Factory_boy is good too.
Fix one test which is guaranteed to fail any time a random string comes up with a hyphen in it (roughly 1 in 976 chance of that happening)
Tested locally on py27, py34, py35, and py36.
Fixes #647