Git Product home page Git Product logo

Comments (3)

gsnedders avatar gsnedders commented on May 24, 2024 1

and that made the following command work for me:

python3 -m pytest --rootdir=. -c tools/pytest.ini --collect-only -q webdriver/tests/bidi/**/*.py

Note pytest has significantly different behaviour when arguments (specifying files) are passed, which changes, among other things, how it finds the initial conftest.py.

This is a significance difference to my command in the original issue.

from wpt.

gsnedders avatar gsnedders commented on May 24, 2024

Note that prepend works if we add __init__.py files all the way up, because we then end up importing unique module names.

from wpt.

OrKoN avatar OrKoN commented on May 24, 2024

I tried to do pytest --collect-only recently and the following workaround worked for me:

To webdriver/tests/__init__.py I have added:

import os
from tools.wpt.utils import load_source

here = os.path.dirname(__file__)

localpaths = load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, os.pardir, "tools", "localpaths.py")))  # type: ignore

and that made the following command work for me:

python3 -m pytest --rootdir=. -c tools/pytest.ini --collect-only -q webdriver/tests/bidi/**/*.py

Normally localpaths are imported in another place that pytest does not know about. This is the output I got https://gist.github.com/OrKoN/e000e32f132db86c102cc35f12fd5852

from wpt.

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.