Skip to content

Commit 5f1a612

Browse files
authored
fix pytest order execution (#1759)
1 parent 14244c9 commit 5f1a612

21 files changed

+220
-128
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ secrets
2323
docs/site
2424
TODO
2525

26-
python-package/tests/tmp_bases
27-
python-package/tests/test_upload/tmp_bases
26+
python-package/tests/tmp/
2827
python-package/tests/outdated
2928
# Byte-compiled / optimized / DLL files
3029
__pycache__/

python-package/basedosdados/upload/datatypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
self.partitioned = partitioned
4848
self.biglake_connection_id = biglake_connection_id
4949

50-
def header(self, data_sample_path, csv_delimiter):
50+
def header(self, data_sample_path, csv_delimiter: str = ","):
5151
"""
5252
Retrieve the header of the data sample
5353
"""

python-package/basedosdados/upload/storage.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
"""
44

55
import sys
6-
7-
86
import time
97
import traceback
108
from pathlib import Path
119

1210
from loguru import logger
1311
from tqdm import tqdm
1412

15-
from basedosdados.exceptions import BaseDosDadosException
1613
from basedosdados.core.base import Base
14+
from basedosdados.exceptions import BaseDosDadosException
1715

1816
# google retryble exceptions. References: https://googleapis.dev/python/storage/latest/retry_timeout.html#module-google.cloud.storage.retry
1917

@@ -243,7 +241,7 @@ def upload(
243241
def download(
244242
self,
245243
filename="*",
246-
savepath=".",
244+
savepath: Path = Path("."),
247245
partitions=None,
248246
mode="staging",
249247
if_not_exists="raise",

python-package/poetry.lock

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python-package/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ mkdocs-static-i18n = "^0.56"
4747

4848
[tool.poetry.group.test.dependencies]
4949
pytest = "^7.2.1"
50+
pytest-order = "^1.3.0"
5051

5152
[tool.poetry.extras]
5253
all = ["gql", "pandavro", "requests-toolbelt"]
@@ -74,7 +75,7 @@ ignore = [
7475
pythonpath = "."
7576
addopts = [
7677
"--ignore=tests/outdated",
77-
"-p no:warnings",
78+
"-p no:warnings"
7879
]
7980

8081
[build-system]

python-package/tests/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import platform
2+
3+
platform_name = platform.system().lower()
4+
5+
DATASET_ID_PREFIX = f"pytest_{platform_name}"
6+
TABLE_ID_PREFIX = f"pytest_{platform_name}"

python-package/tests/test_upload/table/municipio.csv renamed to python-package/tests/sample_data/table/municipio.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51509,4 +51509,4 @@ ano,id_municipio,pib,impostos_liquidos,va,va_agropecuaria,va_industria,va_servic
5150951509
2011,2515500,73092871,4038144,69054727,5173680,3100455,23884184,36896408
5151051510
2011,2515609,18108013,422008,17686005,2611233,722338,2892278,11460157
5151151511
2011,2515708,29021154,445556,28575598,14498479,616558,3210764,10249797
51512-
2011,2515807,38506490,1318838,37187652,3907598,5042877,6514265,21722912
51512+
2011,2515807,38506490,1318838,37187652,3907598,5042877,6514265,21722912

0 commit comments

Comments
 (0)