use getfixturemarker
This commit is contained in:
		
							parent
							
								
									aa9cc7e8b4
								
							
						
					
					
						commit
						a1b10b552a
					
				| 
						 | 
				
			
			@ -387,11 +387,14 @@ def store_mark(obj, mark: Mark) -> None:
 | 
			
		|||
    This is used to implement the Mark declarations/decorators correctly.
 | 
			
		||||
    """
 | 
			
		||||
    assert isinstance(mark, Mark), mark
 | 
			
		||||
    # Always reassign name to avoid updating pytestmark in a reference that
 | 
			
		||||
    # was only borrowed.
 | 
			
		||||
    if hasattr(obj, "_pytestfixturefunction"):
 | 
			
		||||
 | 
			
		||||
    from ..fixtures import getfixturemarker
 | 
			
		||||
 | 
			
		||||
    if getfixturemarker(obj) is not None:
 | 
			
		||||
        warnings.warn(MARKED_FIXTURE, stacklevel=2)
 | 
			
		||||
 | 
			
		||||
    # Always reassign name to avoid updating pytestmark in a reference that
 | 
			
		||||
    # was only borrowed.
 | 
			
		||||
    obj.pytestmark = [*get_unpacked_marks(obj), mark]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue