Exemple #1
0
    def test_visa_main_argument_handling(self):
        """Test we reject invalid values in visa_main."""
        from pyvisa.cmd_line_tools import visa_main

        old = sys.argv = ["python"]
        try:
            with pytest.raises(ValueError):
                visa_main("unknown")
        finally:
            sys.argv = old
Exemple #2
0
    VisaTypeError,
    UnknownHandler,
    OSNotSupported,
    InvalidBinaryFormat,
    InvalidSession,
    LibraryError,
)

# This is needed to registry all resources.
from pyvisa.resources import Resource
from pyvisa.cmd_line_tools import visa_main

__all__ = [
    "ResourceManager",
    "constants",
    "logger",
    "Error",
    "VisaIOError",
    "VisaIOWarning",
    "VisaTypeError",
    "UnknownHandler",
    "OSNotSupported",
    "InvalidBinaryFormat",
    "InvalidSession",
    "LibraryError",
    "log_to_screen",
]

if __name__ == "__main__":
    visa_main()