Git Product home page Git Product logo

Comments (4)

RKrahl avatar RKrahl commented on May 24, 2024 4

Yes, those markers in pytest somewhat look like function calls. So one might expect something like a NameError if using a marker that has not been defined. But in fact, they are more like arbitrary labels that may be attached to a test. That is why the following will work with no complaint:

import pytest

@pytest.mark.funny_marker_that_has_no_meaning_at_all(sense='absent')
def test_funny():
    pass

from pytest-dependency.

jtmoon79 avatar jtmoon79 commented on May 24, 2024 2

Doh!

I added the decorators @pytest.mark.dependency(...) and then pytest didn't crash or complain about the decorator . So I guessed (mistakenly) that meant pytest-dependency was included within pytest.

I did pipenv install pytest-dependency --dev and now it works.

Pardon the noise.

This Issue should be closed.

from pytest-dependency.

RKrahl avatar RKrahl commented on May 24, 2024 1

I cannot reproduce your problem. I get:

$ python3 -m pytest -v              
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python3
cachedir: .cache
rootdir: /usr/src/packages, inifile:
plugins: dependency-0.3.2
collected 2 items                                                              

test_namedclass.py::TestClassNamed::test_a xfail                         [ 50%]
test_namedclass.py::TestClassNamed::test_b SKIPPED                       [100%]

===================== 1 skipped, 1 xfailed in 0.08 seconds =====================

From your pip list output, I'm missing pytest-dependency. Did you install pytest-dependency?

from pytest-dependency.

Hamza5 avatar Hamza5 commented on May 24, 2024

Yes, those markers in pytest somewhat look like function calls. So one might expect something like a NameError if using a marker that has not been defined. But in fact, they are more like arbitrary labels that may be attached to a test. That is why the following will work with no complaint:

import pytest

@pytest.mark.funny_marker_that_has_no_meaning_at_all(sense='absent')
def test_funny():
    pass

I had the same problem because I misspelled the word dependency as dependancy and the tests were not skipped because of that. Thanks for the clarification.

from pytest-dependency.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.