Add .hypothesis to .gitignore and try an older version of Hypothesis for 2.6
This commit is contained in:
commit
23a8e2b469
|
@ -32,3 +32,4 @@ env/
|
||||||
.coverage
|
.coverage
|
||||||
.ropeproject
|
.ropeproject
|
||||||
.idea
|
.idea
|
||||||
|
.hypothesis
|
||||||
|
|
|
@ -29,8 +29,11 @@
|
||||||
|
|
||||||
* parametrize ids can accept None as specific test id. The
|
* parametrize ids can accept None as specific test id. The
|
||||||
automatically generated id for that argument will be used.
|
automatically generated id for that argument will be used.
|
||||||
|
Thanks `@palaviv`_ for the complete PR (`#1468`_).
|
||||||
|
|
||||||
*
|
* improved idmaker name selection in case of duplicate ids in
|
||||||
|
parametrize.
|
||||||
|
Thanks `@palaviv`_ for the complete PR (`#1474`_).
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
|
@ -39,12 +42,15 @@
|
||||||
.. _@kalekundert: https://github.com/kalekundert
|
.. _@kalekundert: https://github.com/kalekundert
|
||||||
.. _@tareqalayan: https://github.com/tareqalayan
|
.. _@tareqalayan: https://github.com/tareqalayan
|
||||||
.. _@ceridwen: https://github.com/ceridwen
|
.. _@ceridwen: https://github.com/ceridwen
|
||||||
|
.. _@palaviv: https://github.com/palaviv
|
||||||
|
|
||||||
.. _#1428: https://github.com/pytest-dev/pytest/pull/1428
|
.. _#1428: https://github.com/pytest-dev/pytest/pull/1428
|
||||||
.. _#1444: https://github.com/pytest-dev/pytest/pull/1444
|
.. _#1444: https://github.com/pytest-dev/pytest/pull/1444
|
||||||
.. _#1441: https://github.com/pytest-dev/pytest/pull/1441
|
.. _#1441: https://github.com/pytest-dev/pytest/pull/1441
|
||||||
.. _#1454: https://github.com/pytest-dev/pytest/pull/1454
|
.. _#1454: https://github.com/pytest-dev/pytest/pull/1454
|
||||||
.. _#1351: https://github.com/pytest-dev/pytest/issues/1351
|
.. _#1351: https://github.com/pytest-dev/pytest/issues/1351
|
||||||
|
.. _#1468: https://github.com/pytest-dev/pytest/pull/1468
|
||||||
|
.. _#1474: https://github.com/pytest-dev/pytest/pull/1474
|
||||||
|
|
||||||
2.9.2.dev1
|
2.9.2.dev1
|
||||||
==========
|
==========
|
||||||
|
|
|
@ -7,6 +7,7 @@ import re
|
||||||
import types
|
import types
|
||||||
import sys
|
import sys
|
||||||
import math
|
import math
|
||||||
|
import collections
|
||||||
|
|
||||||
import py
|
import py
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -1161,9 +1162,14 @@ def _idvalset(idx, valset, argnames, idfn, ids):
|
||||||
def idmaker(argnames, argvalues, idfn=None, ids=None):
|
def idmaker(argnames, argvalues, idfn=None, ids=None):
|
||||||
ids = [_idvalset(valindex, valset, argnames, idfn, ids)
|
ids = [_idvalset(valindex, valset, argnames, idfn, ids)
|
||||||
for valindex, valset in enumerate(argvalues)]
|
for valindex, valset in enumerate(argvalues)]
|
||||||
if len(set(ids)) < len(ids):
|
if len(set(ids)) != len(ids):
|
||||||
# user may have provided a bad idfn which means the ids are not unique
|
# The ids are not unique
|
||||||
ids = [str(i) + testid for i, testid in enumerate(ids)]
|
duplicates = [testid for testid in ids if ids.count(testid) > 1]
|
||||||
|
counters = collections.defaultdict(lambda: 0)
|
||||||
|
for index, testid in enumerate(ids):
|
||||||
|
if testid in duplicates:
|
||||||
|
ids[index] = testid + str(counters[testid])
|
||||||
|
counters[testid] += 1
|
||||||
return ids
|
return ids
|
||||||
|
|
||||||
def showfixtures(config):
|
def showfixtures(config):
|
||||||
|
|
|
@ -254,9 +254,9 @@ class TestMetafunc:
|
||||||
(20, KeyError()),
|
(20, KeyError()),
|
||||||
("three", [1, 2, 3]),
|
("three", [1, 2, 3]),
|
||||||
], idfn=ids)
|
], idfn=ids)
|
||||||
assert result == ["0a-a",
|
assert result == ["a-a0",
|
||||||
"1a-a",
|
"a-a1",
|
||||||
"2a-a",
|
"a-a2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@pytest.mark.issue351
|
@pytest.mark.issue351
|
||||||
|
@ -283,10 +283,9 @@ class TestMetafunc:
|
||||||
|
|
||||||
def test_idmaker_with_ids_unique_names(self):
|
def test_idmaker_with_ids_unique_names(self):
|
||||||
from _pytest.python import idmaker
|
from _pytest.python import idmaker
|
||||||
result = idmaker(("a", "b"), [(1, 2),
|
result = idmaker(("a"), [1,2,3,4,5],
|
||||||
(3, 4)],
|
ids=["a", "a", "b", "c", "b"])
|
||||||
ids=["a", "a"])
|
assert result == ["a0", "a1", "b0", "c", "b1"]
|
||||||
assert result == ["0a", "1a"]
|
|
||||||
|
|
||||||
def test_addcall_and_parametrize(self):
|
def test_addcall_and_parametrize(self):
|
||||||
def func(x, y): pass
|
def func(x, y): pass
|
||||||
|
@ -850,8 +849,8 @@ class TestMetafuncFunctional:
|
||||||
result = testdir.runpytest("-v")
|
result = testdir.runpytest("-v")
|
||||||
assert result.ret == 1
|
assert result.ret == 1
|
||||||
result.stdout.fnmatch_lines_random([
|
result.stdout.fnmatch_lines_random([
|
||||||
"*test_function*0a*PASSED",
|
"*test_function*a0*PASSED",
|
||||||
"*test_function*1a*FAILED"
|
"*test_function*a1*FAILED"
|
||||||
])
|
])
|
||||||
|
|
||||||
@pytest.mark.parametrize(("scope", "length"),
|
@pytest.mark.parametrize(("scope", "length"),
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -18,7 +18,7 @@ deps=
|
||||||
[testenv:py26]
|
[testenv:py26]
|
||||||
commands= py.test --lsof -rfsxX {posargs:testing}
|
commands= py.test --lsof -rfsxX {posargs:testing}
|
||||||
deps=
|
deps=
|
||||||
hypothesis<3.03
|
hypothesis<3.0
|
||||||
nose
|
nose
|
||||||
mock<1.1 # last supported version for py26
|
mock<1.1 # last supported version for py26
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue