2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/1fbd66afdbe5/ Changeset: 1fbd66afdbe5 User: lukaszb Date: 2013-12-19 14:29:57 Summary: Updated error message to be more helpful
Also, added misssing test Affected #: 2 files diff -r 91925448ac067edf770b504d199a8998872a9f10 -r 1fbd66afdbe50558b767d57d632bbb825d048d7d _pytest/mark.py --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -169,7 +169,7 @@ def __getattr__(self, name): if name[0] == "_": - raise AttributeError(name) + raise AttributeError("Marker name must NOT start with underscore") if hasattr(self, '_config'): self._check(name) return MarkDecorator(name) diff -r 91925448ac067edf770b504d199a8998872a9f10 -r 1fbd66afdbe50558b767d57d632bbb825d048d7d testing/test_mark.py --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -15,6 +15,10 @@ mark = Mark() pytest.raises((AttributeError, TypeError), mark) + def test_pytest_mark_name_starts_with_underscore(self): + mark = Mark() + pytest.raises(AttributeError, getattr, mark, '_some_name') + def test_pytest_mark_bare(self): mark = Mark() def f(): https://bitbucket.org/hpk42/pytest/commits/a08359621e20/ Changeset: a08359621e20 User: hpk42 Date: 2013-12-19 16:13:13 Summary: Merge pull request #9 from lukaszb/mark-error-message Updated error message to be more helpful. Affected #: 2 files diff -r 91925448ac067edf770b504d199a8998872a9f10 -r a08359621e206ab04be9d9009f47d5b555adf3d5 _pytest/mark.py --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -169,7 +169,7 @@ def __getattr__(self, name): if name[0] == "_": - raise AttributeError(name) + raise AttributeError("Marker name must NOT start with underscore") if hasattr(self, '_config'): self._check(name) return MarkDecorator(name) diff -r 91925448ac067edf770b504d199a8998872a9f10 -r a08359621e206ab04be9d9009f47d5b555adf3d5 testing/test_mark.py --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -15,6 +15,10 @@ mark = Mark() pytest.raises((AttributeError, TypeError), mark) + def test_pytest_mark_name_starts_with_underscore(self): + mark = Mark() + pytest.raises(AttributeError, getattr, mark, '_some_name') + def test_pytest_mark_bare(self): mark = Mark() def f(): 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. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit