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

Initial backend for Next Gen #426

Merged
merged 5 commits into from
May 9, 2021

Conversation

BeyondEvil
Copy link
Contributor

@BeyondEvil BeyondEvil commented Dec 16, 2020

The initial backend, implemented alongside the "legacy" report.

It will create a JSON file with the title, environment (from metadata) and all tests.

Any calculations, summary of passed/failed, durations etc. will be left to the frontend.

extras and hooks are not implemented yet.

I know why the tests are failing, will fix tomorrow.

@BeyondEvil BeyondEvil changed the base branch from master to next-gen December 16, 2020 01:32
@gnikonorov
Copy link
Member

🎉 Thanks @BeyondEvil ! I'll take a look as soon as I can

Copy link
Member

@gnikonorov gnikonorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than these comments, LGTM! Thank you again @BeyondEvil !

@@ -0,0 +1,66 @@
import json
from typing import Any

This comment was marked as outdated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened an issue to track typing (#434)

I also added mypy to our linting target and began work on typing the project in #435

data = json.dumps(data)

with self._data_file.open("w", buffering=1, encoding="UTF-8") as f:
f.write("const jsonData = ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we combine these f.write calls on an f string line f"const jsonData = {data}\n"?

f.write("\n")

@pytest.hookimpl(trylast=True)
def pytest_sessionstart(self, session):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't all the self._write calls overwrite self._data_file?

@BeyondEvil BeyondEvil merged commit 68c72c7 into pytest-dev:next-gen May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants