[Pytest-commit] commit/pytest: flub: Use capital Y as the tests look for that

2015-04-13 Thread commits-noreply
1 new commit in pytest:

https://bitbucket.org/pytest-dev/pytest/commits/7d32b89da36e/
Changeset:   7d32b89da36e
User:flub
Date:2015-04-13 08:08:10+00:00
Summary: Use capital Y as the tests look for that
Affected #:  1 file

diff -r 508d2b3cb60efa1d38d86f83021cedfcd582742d -r 
7d32b89da36e8714554fae12483a1fbb2bf7c1c7 _pytest/python.py
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -1451,7 +1451,7 @@
 if scopemismatch(invoking_scope, requested_scope):
 # try to report something helpful
 lines = self._factorytraceback()
-pytest.fail("ScopeMismatch: you tried to access the %r scoped "
+pytest.fail("ScopeMismatch: You tried to access the %r scoped "
 "fixture %r with a %r scoped request object, "
 "involved factories\n%s" %(
 (requested_scope, argname, invoking_scope, "\n".join(lines))),

Repository URL: https://bitbucket.org/pytest-dev/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.
___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[Pytest-commit] Issue #235: tox --installpkg raises an AttributeError (hpk42/tox)

2015-04-13 Thread Michael van Tellingen
New issue 235: tox --installpkg raises an AttributeError
https://bitbucket.org/hpk42/tox/issue/235/tox-installpkg-raises-an-attributeerror

Michael van Tellingen:

tox --installpkg dist/something.tgz raises an attributeerror:


```
#!python

Traceback (most recent call last):
  File "/Users/mvantellingen/virtualenvs/something/bin/tox", line 9, in 
load_entry_point('tox==1.8.0', 'console_scripts', 'tox')()
  File 
"/Users/mvantellingen/virtualenvs/something/lib/python2.7/site-packages/tox/_cmdline.py",
 line 26, in main
retcode = Session(config).runcommand()
  File 
"/Users/mvantellingen/virtualenvs/something/lib/python2.7/site-packages/tox/_cmdline.py",
 line 310, in runcommand
return self.subcommand_test()
  File 
"/Users/mvantellingen/virtualenvs/something/lib/python2.7/site-packages/tox/_cmdline.py",
 line 454, in subcommand_test
self.installpkg(venv, sdist_path)
  File 
"/Users/mvantellingen/virtualenvs/something/lib/python2.7/site-packages/tox/_cmdline.py",
 line 397, in installpkg
self.resultlog.set_header(installpkg=sdist_path)
  File 
"/Users/mvantellingen/virtualenvs/something/lib/python2.7/site-packages/tox/result.py",
 line 21, in set_header
md5=installpkg.computehash("md5"),
AttributeError: 'str' object has no attribute 'computehash'

```



___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[Pytest-commit] Issue #718: Failure to create representation with sets having "unsortable" elements (pytest-dev/pytest)

2015-04-13 Thread Edison Gustavo Muenz
New issue 718: Failure to create representation with sets having "unsortable" 
elements
https://bitbucket.org/pytest-dev/pytest/issue/718/failure-to-create-representation-with-sets

Edison Gustavo Muenz:

I’m using Python 2.7.7 (The error also happens on Python 2.7.9)

The following code fails:

```python
def test_pretty_printer_screws_up_representation():
class UnsortableKey(object):
def __init__(self, name):
self.name = name

def __lt__(self, other):
raise RuntimeError()

def __repr__(self):
return self.name

def __hash__(self):
return hash(self.name)

def __eq__(self, other):
return self.name == other.name

assert {UnsortableKey('1'), UnsortableKey('2')} == {UnsortableKey('2')}

>   assert {UnsortableKey('1'), UnsortableKey('2')} == {UnsortableKey('2')}
E   assert set([1, 2]) == set([2])
E (pytest_assertion plugin: representation of details failed.  Probably 
an object has a faulty __repr__.)
E 
X:\etk\coilib50\source\python\coilib50\_pytest\_tests\pytest_almost_equal.py:766:
 RuntimeError
```

While debugging, the problem happens in this 
[line](https://github.com/python/cpython/blob/2.7/Lib/pprint.py#L199) of 
pprint.py (The [PrettyPrinter 
module](https://docs.python.org/2/library/pprint.html)).

It assumes that the “object” can have the method sorted() called on it, which 
is not always true. The `repr.py` module handles this correctly, but 
`pprint.py` doesn’t.

This is the full [traceback](http://pastebin.com/t9a9amcR) (I printed it from 
the the `__lt__()` method).

I think that this should be handled by `pprint.py`, however, it is tied to the 
python version being used. Maybe pytest could handle this as a workaround this 
limitation of `pprint.py`?

Fixing it in `pprint.py` looks straightforward: just handle it like `repr.py` 
[does](https://hg.python.org/cpython/file/2.7/Lib/repr.py#l122), by using the 
`_possiblysorted()` method.


___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[Pytest-commit] commit/pytest: RonnyPfannschmidt: move evaluation and caching of mark expressions to own function

2015-04-13 Thread commits-noreply
1 new commit in pytest:

https://bitbucket.org/pytest-dev/pytest/commits/551a54d002fd/
Changeset:   551a54d002fd
Branch:  markexpr-parser
User:RonnyPfannschmidt
Date:2015-04-13 17:37:34+00:00
Summary: move evaluation and caching of mark expressions to own function
Affected #:  1 file

diff -r bf6f8a626afb870b19a91ff3993203e264fc2e9c -r 
551a54d002fda8db9a947063ce37c14ed5edcea0 _pytest/mark.py
--- a/_pytest/mark.py
+++ b/_pytest/mark.py
@@ -113,9 +113,15 @@
 return False
 
 
+def _match_expr(expr, globals_, __cache={}):
+if expr not in __cache:
+__cache[expr] = compile(expr, expr, 'eval')
+return eval(__cache[expr], {}, globals_)
+
+
 def matchmark(colitem, markexpr):
 """Tries to match on any marker names, attached to the given colitem."""
-return eval(markexpr, {}, MarkMapping(colitem.keywords))
+return _match_expr(markexpr, MarkMapping(colitem.keywords))
 
 
 def matchkeyword(colitem, keywordexpr):
@@ -150,7 +156,7 @@
 return mapping[keywordexpr]
 elif keywordexpr.startswith("not ") and " " not in keywordexpr[4:]:
 return not mapping[keywordexpr[4:]]
-return eval(keywordexpr, {}, mapping)
+return _match_expr(keywordexpr, mapping)
 
 
 def pytest_configure(config):

Repository URL: https://bitbucket.org/pytest-dev/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.
___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[Pytest-commit] [FAIL] pytest - # 67

2015-04-13 Thread Drone.io Build
Build Failed

Build  : https://drone.io/bitbucket.org/pytest-dev/pytest/67
Project: https://drone.io/bitbucket.org/pytest-dev/pytest

Repository : https://bitbucket.org/pytest-dev/pytest
Version: 3928:551a54d002fd
Author : Ronny Pfannschmidt 
Branch : markexpr-parser

Message:
move evaluation and caching of mark expressions to own function

___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit


[Pytest-commit] Issue #719: pytest.mark.parametrize string-based parameter list doesn't handle single element tuples (pytest-dev/pytest)

2015-04-13 Thread David Haney
New issue 719: pytest.mark.parametrize string-based parameter list doesn't 
handle single element tuples
https://bitbucket.org/pytest-dev/pytest/issue/719/pytestmarkparametrize-string-based

David Haney:

When specifying a `@pytest.mark.parametrize` element composed of a one-element 
tuple, I'm unable to use the string-based argument list, for example:

@pytest.mark.parametrize("arg", scenarios)
def test(arg):
print(arg)
assert(arg == "a") # this assert always fails

arg ends up being the tuple instead of the first item in the tuple (as I would 
expected based on tuples with more than one item. I also tried:

@pytest.mark.parametrize("arg,", scenarios)

but that also associated the entire tuple with arg instead of the first 
element. I reverted back to the older model of specifying the arguments as a 
tuple:

@pytest.mark.parametrize("arg,", scenarios)

Finally I switched back to the older style of using a tuple to specify the 
parameter list:

@pytest.mark.parametrize(("arg",), scenarios)

This version worked. This seems to imply that there is either a bug/limitation 
in the new string-based parameter specification, or that there is still a 
use-case for the tuple-based parameter specification. It would be helpful if 
either the string-based implementation could be updated to handle this 
situation, or if the documentation could be updated to note when the 
tuple-based parameter specification is still needed.


___
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit