Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 33bfbd7

Browse files
committed
raise without --debug, expand cli test
1 parent 8f8cdf8 commit 33bfbd7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

data_diff/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,7 @@ def main(conf, run, **kw):
327327
)
328328
except Exception as e:
329329
logging.error(e)
330-
if kw["debug"]:
331-
raise
330+
raise
332331

333332

334333
def _data_diff(

tests/test_cli.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111

1212
def run_datadiff_cli(*args):
1313
try:
14-
stdout = subprocess.check_output(
15-
[sys.executable, "-m", "data_diff", "--no-tracking"] + list(args), stderr=subprocess.PIPE
14+
p = subprocess.Popen(
15+
[sys.executable, "-m", "data_diff", "--no-tracking"] + list(args),
16+
stdout=subprocess.PIPE,
17+
stderr=subprocess.PIPE,
1618
)
19+
stdout, stderr = p.communicate()
1720
except subprocess.CalledProcessError as e:
1821
logging.error(e.stderr)
1922
raise
23+
if stderr:
24+
raise Exception(stderr)
2025
return stdout.splitlines()
2126

2227

@@ -48,6 +53,7 @@ def setUp(self) -> None:
4853
def test_basic(self):
4954
conn_str = CONN_STRINGS[self.db_cls]
5055
diff = run_datadiff_cli(conn_str, self.table_src_name, conn_str, self.table_dst_name)
56+
5157
assert len(diff) == 1
5258

5359
def test_options(self):

0 commit comments

Comments
 (0)