Skip to main content

psgtest

A PySimpleGUI Application

Simple Python Testing

Run your Python programs using the interpreter version of your choice, and display the output in a GUI window.

Features

  • Project testing application to perform regression, stress, and compatibility testing
  • Run your Python test programs at the click of a button
  • Test using any Python interpreter version
  • Run batches of tests to perform regression testing and stress testing
  • Get programs output in individual tabs for easy debugging

Installation

Using PIP with PyPI

The latest official release of PySimpleGUI products can be found on PyPI. To pip install the demo applications from PyPI, use this command

If you use the command python on your computer to invoke Python (Windows):

python -m pip install --upgrade psgtest

If you use the command python3 on your computer to invoke Python (Linux, Mac):

python3 -m pip install --upgrade psgtest

Using PIP with GitHub

You can also pip install the PySimpleGUI Applications that are in the PySimpleGUI GitHub account. The GitHub versions have bug fixes and new programs/features that have not yet been released to PyPI. To directly pip install from that repo:

If you use the command python on your computer to invoke Python (Windows):

python -m pip install --upgrade https://github.com/PySimpleGUI/psgtest/zipball/main

If you use the command python3 on your computer to invoke Python (Linux, Mac):

python3 -m pip install --upgrade https://github.com/PySimpleGUI/psgtest/zipball/main

Usage

Once installed, launch psgtest by typing the following in your command line:

psgtest

About

This is an example of another utility used in the development of PySimpleGUI that is being released for other PySimpleGUI users to use either as a standalone tool or as example code / design pattern to follow.

It can be challenging to manage multiple versions of Python and the need to test across multiple versions. Virtual Environments are one approach that are often used. psgtest does not use virtual environments. Instead, it invokes the Python interpreter of your choice directly.

The advantage is that changing which version of Python that's used is changed in a single drop-down menu selection as shown in the example GIF above. The session in the GIF shows launching the PySimpleGUI main test harness using multiple versions of Python by selecting the version from the drop-down at the top.

Executing Multiple Programs

To run multiple programs, select the files to run from the list of files on the left portion of the window. Then click the "Run" button.

Editing Programs

You can also edit the programs selected by clicking the "Edit" button. You will need to set up your editor using the PySimpleGUI global settings. If you have pip installed a version of PySimpleGUI that's 4.53.0.14 or greater, then you can type psgsettings from the command line. You can also change the settings by calling sg.main() (or typing from the command line psgmain).

Specifying/Selecting Python Interpreter Locations

The Setup Window is where you enter the path to each version of Python that you want to test with. The settings are stored in a file and thus will be saved from one run to another.

Selecting the version to use can be done in either the settings window or using the drop-down menu in the main window.

Output

The stdout and stderr from each program you execute are displayed in a tab with a name that matches your filename. Each program you run will open a new tab.

In each tab you'll find 2 buttons that operate on the output shown in that tab.

Use the Copy To Clipboard button to copy the contents of the output to the clipboard.

Use the Clear button to delete the output.

The Close Tab button closes the tab as does the right click menu item Close. If you run the program again after closing the tab, the old contents of the tab are retained and shown when the tab is "re-opened". (See the GIF above for an example)

Make a Windows Shortcut

If you're running Windows, then you can use psgshortcut to make a shortcut to the .pyw file (if you download psgtest from GitHub) or the .py file (if you pip installed). The icon for psgtest is in this repo and is also included when you pip install psgtest. It's in the same folder as the gui.py file.

You can find the location of psgtest after pip installing it by running psgtest, right clicking, and choosing "File Location". You'll be shown where the gui.py file is located (the name of the psgtest program when pip installed). It will usually be located in the site-packages folder in a folder named psgtest.

Copyright 2023-2024 PySimpleSoft, Inc. and/or its licensors.

This is a free-to-use "Utility" and is licensed under the PySimpleGUI License Agreement, a copy of which is included in the license.txt file and also available at https://pysimplegui.com/eula.

Please see Section 1.2 of the license regarding the use of this Utility, and see https://pysimplegui.com/faq for any questions.

Contributing

We are happy to receive issues describing bug reports and feature requests! If your bug report relates to a security vulnerability, please do not file a public issue, and please instead reach out to us at issues@PySimpleGUI.com.

We do not accept (and do not wish to receive) contributions of user-created or third-party code, including patches, pull requests, or code snippets incorporated into submitted issues. Please do not send us any such code! Bug reports and feature requests should not include any source code.

If you nonetheless submit any user-created or third-party code to us, (1) you assign to us all rights and title in or relating to the code; and (2) to the extent any such assignment is not fully effective, you hereby grant to us a royalty-free, perpetual, irrevocable, worldwide, unlimited, sublicensable, transferrable license under all intellectual property rights embodied therein or relating thereto, to exploit the code in any manner we choose, including to incorporate the code into PySimpleGUI and to redistribute it under any terms at our discretion.

Metadata

Release files for psgtest 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psgtest 5.0.0
File Size Uploaded
psgtest-5.0.0.tar.gz 3.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for psgtest 5.0.0
File Interpreter ABI Platform
psgtest-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 MB

Release files / psgtest-5.0.0.tar.gz

Download URL psgtest-5.0.0.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
45f800e7fe82dff3871059a47a106347c089f373dd0223483f3d04c3a5a026c7
BLAKE2b-256 checksum
How to use checksums
1090762dfd5f63ef898eab7a2e1fc3418e05b0b99809ab1d5e5c80b8135eefdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.11

Release files / psgtest-5.0.0-py3-none-any.whl

Download URL psgtest-5.0.0-py3-none-any.whl
Size 3.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e2afcab40d3f77a9c2130eec23ce2dca3b924b25c2389048b88104d6fe5c7839
BLAKE2b-256 checksum
How to use checksums
32baa47ea1e1085a52cd62900f37c0a90e4c1a24b437b137aea291de8c6ab767
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.11

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

3.4

2 release files

3.2

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0

3 release files

1.14

2 release files

1.12.2

2 release files

1.12.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page