[Pytest-commit] commit/pytest: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Dec 20 09:33:23 CET 2013


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.


More information about the pytest-commit mailing list