Use py.builtin._basestring
This commit is contained in:
		
							parent
							
								
									850fd2b7f7
								
							
						
					
					
						commit
						6d1662e4b7
					
				|  | @ -3,12 +3,6 @@ | ||||||
| import py, pytest | import py, pytest | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| # Provide basestring in python3 |  | ||||||
| try: |  | ||||||
|     basestring = basestring |  | ||||||
| except NameError: |  | ||||||
|     basestring = str |  | ||||||
| 
 |  | ||||||
| def pytest_addoption(parser): | def pytest_addoption(parser): | ||||||
|     group = parser.getgroup("general") |     group = parser.getgroup("general") | ||||||
|     group.addoption('--runxfail', |     group.addoption('--runxfail', | ||||||
|  | @ -92,7 +86,7 @@ class MarkEvaluator: | ||||||
|                 self.result = False |                 self.result = False | ||||||
|                 for expr in self.holder.args: |                 for expr in self.holder.args: | ||||||
|                     self.expr = expr |                     self.expr = expr | ||||||
|                     if isinstance(expr, basestring): |                     if isinstance(expr, py.builtin._basestring): | ||||||
|                         result = cached_eval(self.item.config, expr, d) |                         result = cached_eval(self.item.config, expr, d) | ||||||
|                     else: |                     else: | ||||||
|                         pytest.fail("expression is not a string") |                         pytest.fail("expression is not a string") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue