Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 3, 2024
1 parent d72e326 commit 5f7e403
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ def find_viz_files(directory):
viz_files = []
for root, _, files in os.walk(directory):
for file in files:
if file in ['app.py', 'viz.py']:
if file in ["app.py", "viz.py"]:
viz_files.append(os.path.join(root, file))
return viz_files


def run_solara_app(file_path):
process = subprocess.Popen(['solara', 'run', file_path])
process = subprocess.Popen(["solara", "run", file_path])
time.sleep(5) # Wait for the app to start
return process


def send_step_command(times=1):
for _ in range(times):
subprocess.run(['xdotool', 'key', 'space'])
subprocess.run(["xdotool", "key", "space"])
time.sleep(0.5)


def send_pause_command():
subprocess.run(['xdotool', 'key', 'p'])
subprocess.run(["xdotool", "key", "p"])
time.sleep(0.5)


def send_reset_command():
subprocess.run(['xdotool', 'key', 'r'])
subprocess.run(["xdotool", "key", "r"])
time.sleep(0.5)


@pytest.mark.parametrize('viz_file', find_viz_files('examples'))
@pytest.mark.parametrize("viz_file", find_viz_files("examples"))
def test_viz_app(viz_file):
process = run_solara_app(viz_file)

Expand Down Expand Up @@ -66,5 +66,5 @@ def test_viz_app(viz_file):
process.wait()


if __name__ == '__main__':
if __name__ == "__main__":
pytest.main([__file__])

0 comments on commit 5f7e403

Please sign in to comment.