Closed JoshRosen closed 5 years ago
Merging #9 into dev will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## dev #9 +/- ##
=========================================
+ Coverage 99.4% 99.41% +<.01%
=========================================
Files 9 9
Lines 168 170 +2
=========================================
+ Hits 167 169 +2
Misses 1 1
Impacted Files | Coverage Δ | |
---|---|---|
hypothesis_sqlalchemy/records.py | 100% <100%> (ø) |
:arrow_up: |
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 7563f33...a796ddf. Read the comment docs.
@JoshRosen: thanks for your contribution, let me take a look
I've changed target branch to dev
, because there are some refactoring changes that I wanted to apply once something significant will be added, after that I'll bump patch version and upload new package to PyPI
This PR fixes a corner case bug in the
tables.records
generator: ifmin_records >= 2
and the table schema has no unique columns then Hypothesis would fail to generate examples.The problem is the
unique_by
function passed tostrategies.lists
: if a table has no unique columns thento_unique_fields()
will return an empty tuple for every record, causing all records to have the same uniqueness key. Instead, I think we should passunique_by=None
when there are no unique columns.Here, I added a regression test and implemented that fix.
(Thanks for the cool library! I'm experimenting with using Hypothesis for testing SQL database engines and your code has been useful for handling the data generation pieces.)