Skip to content

Commit

Permalink
Remove duplicate call to shell.main (#687)
Browse files Browse the repository at this point in the history
* remove duplicate calls to shell.main

* update unit test to count occurrences

* update changes

* update with PR number
  • Loading branch information
sean-moore3 committed Aug 19, 2022
1 parent a7e395b commit 0029da2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PyVISA Changelog
Flow control attribute per ivi foundation definition is a flag and
multiple flow control types can be set.
- move all setup metadata to pyproject.toml PR #600
- remove duplicate call to the command loop after running pyvisa-shell PR #687

1.11.3 (07-11-2020)
-------------------
Expand Down
2 changes: 0 additions & 2 deletions pyvisa/cmd_line_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def visa_main(command: Optional[str] = None) -> None:
from pyvisa import shell

shell.main("@" + args.backend if args.backend else "")

shell.main("@" + args.backend if args.backend else "")
else:
raise ValueError(
f"Unknown command {args.command}. Valid values are: info and shell"
Expand Down
2 changes: 1 addition & 1 deletion pyvisa/testsuite/test_cmd_line_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def test_visa_shell(self):
"""Test the visa shell function."""
with Popen(["pyvisa-shell"], stdin=PIPE, stdout=PIPE) as p:
stdout, stderr = p.communicate(b"exit")
assert b"Welcome to the VISA shell" in stdout
assert stdout.count(b"Welcome to the VISA shell") == 1

0 comments on commit 0029da2

Please sign in to comment.