Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header loading text order #12143

Open
germa89 opened this issue Mar 20, 2024 · 1 comment
Open

Header loading text order #12143

germa89 opened this issue Mar 20, 2024 · 1 comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@germa89
Copy link

germa89 commented Mar 20, 2024

I'm trying to customize the test header:

$ pytest
=================================================================== test session starts ===================================================================
platform linux -- Python 3.10.13, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/ubuntu/pymapdl
configfile: pyproject.toml
testpaths: tests
plugins: cov-4.1.0, anyio-4.3.0, sphinx-0.6.0, pytest_pyvista-0.1.9, rerunfailures-14.0, memprof-0.2.0

by modifying this function:

@pytest.hookimpl(trylast=True)
def pytest_report_header(config, start_path, startdir):
    return "Useful reports"

However the platform linux ... get always first, which is annoying, and, in my humble opinion, it is a bug.

$ pytest
=================================================================== test session starts ===================================================================
platform linux -- Python 3.10.13, pytest-8.1.1, pluggy-1.4.0
Useful reports
rootdir: /home/ubuntu/pymapdl
configfile: pyproject.toml
testpaths: tests
plugins: cov-4.1.0, anyio-4.3.0, sphinx-0.6.0, pytest_pyvista-0.1.9, rerunfailures-14.0, memprof-0.2.0

I'm happy to do a PR on this if this issue feedback is positive.

@germa89
Copy link
Author

germa89 commented Mar 20, 2024

Presumably, it is this function which it should be changed:

def pytest_sessionstart(self, session: "Session") -> None:

@Zac-HD Zac-HD added type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature topic: reporting related to terminal output and user-facing messages and errors labels Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

2 participants