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

Commit

Permalink
raise without --debug, expand cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlawin committed Oct 3, 2023
1 parent 8f8cdf8 commit 33bfbd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions data_diff/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ def main(conf, run, **kw):
)
except Exception as e:
logging.error(e)
if kw["debug"]:
raise
raise


def _data_diff(
Expand Down
10 changes: 8 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@

def run_datadiff_cli(*args):
try:
stdout = subprocess.check_output(
[sys.executable, "-m", "data_diff", "--no-tracking"] + list(args), stderr=subprocess.PIPE
p = subprocess.Popen(
[sys.executable, "-m", "data_diff", "--no-tracking"] + list(args),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
stdout, stderr = p.communicate()
except subprocess.CalledProcessError as e:
logging.error(e.stderr)
raise
if stderr:
raise Exception(stderr)
return stdout.splitlines()


Expand Down Expand Up @@ -48,6 +53,7 @@ def setUp(self) -> None:
def test_basic(self):
conn_str = CONN_STRINGS[self.db_cls]
diff = run_datadiff_cli(conn_str, self.table_src_name, conn_str, self.table_dst_name)

assert len(diff) == 1

def test_options(self):
Expand Down

0 comments on commit 33bfbd7

Please sign in to comment.