feat: Switch from nosetest to pytest (#10177)

* Switch from nosetest to pytest

Fix schedule tests

Collect pytest coverage

Move pytest config into pytest.ini

Move cov to the pytest.ini

* Append coverage for the 2nd run

* Add coverage to all commands

* Coverage only for tests

* Get coverage from 1 place

* Rename classes to be  pytest compatible

* Test coverage for examples and tests

* Max diff to -1

* Explain how to run pytest for the whole project

* Do not append code coverage for the main run

* Do not run coverage on examples

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
Bogdan
2020-06-29 15:36:06 -07:00
committed by GitHub
parent 72fc581b15
commit 4e340c8368
71 changed files with 139 additions and 155 deletions

View File

@@ -42,7 +42,7 @@ from tests.base_tests import SupersetTestCase
from .utils import read_fixture
class SchedulesTestCase(SupersetTestCase):
class TestSchedules(SupersetTestCase):
RECIPIENTS = "recipient1@superset.com, recipient2@superset.com"
BCC = "bcc@superset.com"
@@ -379,7 +379,7 @@ class SchedulesTestCase(SupersetTestCase):
{
"channels": "#test_channel",
"file": element.screenshot_as_png,
"initial_comment": "\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/1/|Explore in Superset>\n ",
"initial_comment": f"\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/{schedule.slice_id}/|Explore in Superset>\n ",
"title": "[Report] Participants",
},
)
@@ -434,7 +434,7 @@ class SchedulesTestCase(SupersetTestCase):
{
"channels": "#test_channel",
"file": element.screenshot_as_png,
"initial_comment": "\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/1/|Explore in Superset>\n ",
"initial_comment": f"\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/{schedule.slice_id}/|Explore in Superset>\n ",
"title": "[Report] Participants",
},
)
@@ -481,7 +481,7 @@ class SchedulesTestCase(SupersetTestCase):
{
"channels": "#test_channel",
"file": self.CSV,
"initial_comment": "\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/1/|Explore in Superset>\n ",
"initial_comment": f"\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/{schedule.slice_id}/|Explore in Superset>\n ",
"title": "[Report] Participants",
},
)
@@ -526,7 +526,7 @@ class SchedulesTestCase(SupersetTestCase):
{
"channels": "#test_channel",
"file": self.CSV,
"initial_comment": "\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/1/|Explore in Superset>\n ",
"initial_comment": f"\n *Participants*\n\n <http://0.0.0.0:8080/superset/slice/{schedule.slice_id}/|Explore in Superset>\n ",
"title": "[Report] Participants",
},
)