Skip to content

Commit

Permalink
Convert threading tests to pytest (#6226)
Browse files Browse the repository at this point in the history
  • Loading branch information
stu-k authored Nov 8, 2022
1 parent 930bd35 commit 4e78618
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 48 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Under the Hood-20221108-074550.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Under the Hood
body: Convert threading tests to pytest
time: 2022-11-08T07:45:50.589147-06:00
custom:
Author: stu-k
Issue: "5942"
PR: "6226"
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions test/integration/031_thread_count_tests/test_thread_count.py

This file was deleted.

46 changes: 46 additions & 0 deletions tests/functional/threading/test_thread_count.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import pytest
from dbt.tests.util import run_dbt


models__do_nothing__sql = """
with x as (select pg_sleep(1)) select 1
"""


class TestThreadCount:
@pytest.fixture(scope="class")
def models(self):
return {
"do_nothing_1.sql": models__do_nothing__sql,
"do_nothing_2.sql": models__do_nothing__sql,
"do_nothing_3.sql": models__do_nothing__sql,
"do_nothing_4.sql": models__do_nothing__sql,
"do_nothing_5.sql": models__do_nothing__sql,
"do_nothing_6.sql": models__do_nothing__sql,
"do_nothing_7.sql": models__do_nothing__sql,
"do_nothing_8.sql": models__do_nothing__sql,
"do_nothing_9.sql": models__do_nothing__sql,
"do_nothing_10.sql": models__do_nothing__sql,
"do_nothing_11.sql": models__do_nothing__sql,
"do_nothing_12.sql": models__do_nothing__sql,
"do_nothing_13.sql": models__do_nothing__sql,
"do_nothing_14.sql": models__do_nothing__sql,
"do_nothing_15.sql": models__do_nothing__sql,
"do_nothing_16.sql": models__do_nothing__sql,
"do_nothing_17.sql": models__do_nothing__sql,
"do_nothing_18.sql": models__do_nothing__sql,
"do_nothing_19.sql": models__do_nothing__sql,
"do_nothing_20.sql": models__do_nothing__sql,
}

@pytest.fixture(scope="class")
def project_config_update(self):
return {"config-version": 2}

@pytest.fixture(scope="class")
def profiles_config_update(self):
return {"threads": 2}

def test_threading_8x(self, project):
results = run_dbt(args=["run", "--threads", "16"])
assert len(results), 20

0 comments on commit 4e78618

Please sign in to comment.