[py-svn] commit/pytest: hpk42: fixes to against python3.3
Bitbucket
commits-noreply at bitbucket.org
Mon Oct 1 10:15:08 CEST 2012
1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/3414d67a4601/
changeset: 3414d67a4601
user: hpk42
date: 2012-10-01 10:14:54
summary: fixes to against python3.3
affected #: 5 files
diff -r 8a116c6b207a0b4fa75eb690fee7b2a8c07631ce -r 3414d67a4601e6ef427a6b4fac09ffd21c387e31 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
Changes between 2.2.4 and 2.3.0.dev
-----------------------------------
+- fix python3.3 compat, mostly reporting bits that previously depended
+ on dict ordering
- introduce a generic "markers" object on Nodes and a request.node
attribute pointing to the scope-specific collection node of a request.
node.markers allows reading and manipulating of MarkInfo objects
diff -r 8a116c6b207a0b4fa75eb690fee7b2a8c07631ce -r 3414d67a4601e6ef427a6b4fac09ffd21c387e31 _pytest/python.py
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -652,6 +652,7 @@
for i, valset in enumerate(argvalues):
assert len(valset) == len(argnames)
newcallspec = callspec.copy(self)
+ #print ("setmulti %r id %r" % (argnames, ids[i]))
newcallspec.setmulti(valtype, argnames, valset, ids[i],
scopenum)
newcalls.append(newcallspec)
@@ -1113,8 +1114,6 @@
self._addfinalizer(finalizer, scope=scope)
return val
-
-
def getfuncargvalue(self, argname):
""" Retrieve a function argument by name for this test
function invocation. This allows one function argument factory
@@ -1408,11 +1407,13 @@
def getsetuplist(self, node):
nodeid = node.nodeid
l = []
- allargnames = set()
+ allargnames = []
for setupcall in self.setuplist:
if nodeid.startswith(setupcall.baseid):
l.append(setupcall)
- allargnames.update(setupcall.funcargnames)
+ for arg in setupcall.funcargnames:
+ if arg not in allargnames:
+ allargnames.append(arg)
l.sort(key=lambda x: x.scopenum)
return l, allargnames
diff -r 8a116c6b207a0b4fa75eb690fee7b2a8c07631ce -r 3414d67a4601e6ef427a6b4fac09ffd21c387e31 _pytest/terminal.py
--- a/_pytest/terminal.py
+++ b/_pytest/terminal.py
@@ -440,7 +440,7 @@
def summary_stats(self):
session_duration = py.std.time.time() - self._sessionstarttime
- keys = "failed passed skipped deselected".split()
+ keys = "failed passed skipped deselected xfailed xpassed".split()
for key in self.stats.keys():
if key not in keys:
keys.append(key)
diff -r 8a116c6b207a0b4fa75eb690fee7b2a8c07631ce -r 3414d67a4601e6ef427a6b4fac09ffd21c387e31 testing/acceptance_test.py
--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -71,7 +71,7 @@
"*---configure",
"*---unconfigure",
])
-
+
def test_config_preparse_plugin_option(self, testdir):
testdir.makepyfile(pytest_xyz="""
@@ -357,13 +357,13 @@
@pytest.mark.skipif("sys.version_info < (2,5)")
def test_python_minus_m_invocation_ok(self, testdir):
p1 = testdir.makepyfile("def test_hello(): pass")
- res = testdir.run(py.std.sys.executable, "-m", "py.test", str(p1))
+ res = testdir.run(py.std.sys.executable, "-m", "pytest", str(p1))
assert res.ret == 0
@pytest.mark.skipif("sys.version_info < (2,5)")
def test_python_minus_m_invocation_fail(self, testdir):
p1 = testdir.makepyfile("def test_fail(): 0/0")
- res = testdir.run(py.std.sys.executable, "-m", "py.test", str(p1))
+ res = testdir.run(py.std.sys.executable, "-m", "pytest", str(p1))
assert res.ret == 1
@pytest.mark.skipif("sys.version_info < (2,5)")
diff -r 8a116c6b207a0b4fa75eb690fee7b2a8c07631ce -r 3414d67a4601e6ef427a6b4fac09ffd21c387e31 testing/test_python.py
--- a/testing/test_python.py
+++ b/testing/test_python.py
@@ -2391,7 +2391,7 @@
def test_3(self):
pass
""")
- result = testdir.runpytest("-v")
+ result = testdir.runpytest("-vs")
result.stdout.fnmatch_lines("""
test_class_ordering.py:4: TestClass2.test_1[1-a] PASSED
test_class_ordering.py:4: TestClass2.test_1[2-a] PASSED
Repository URL: https://bitbucket.org/hpk42/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list