
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
This little plugin uses python-dotenv
to load any environment variables from a .env
file. Extra configuration can be defined in any pytest
config files, such as pytest.ini
, tox.ini
and so on.
Install the plugin with pip
:
$ pip install pytest-dotenv
If all you want is to load environment variables from a .env
file then installing the plugin is all that is needed. python-dotenv
will automatically detect your .env
file and load it. By default, the plugin won't override any existing system variables.
Add a new section to a config file named env_vars
.
You can list as many files as necessary:
[pytest]
env_files =
.env
.test.env
.deploy.env
The files will be loaded and added to the os.environ
dict object before
any tests are run. If the files are not found on the working directory, it will search for the files in the ancestor directory and upwards.
By default the plugin will not override any variables already defined in the
process' environment. If you want that behavior, you have to use the
env_override_existing_values
setting:
[pytest]
env_override_existing_values = 1
env_files =
.env
.test.env
.deploy.env
You also have the option to run your tests with py.test --envfile path/to/.env
.
This will load all defined environment variables and overwrite any existing ones regardless of the configuration env_override_existing_values
.
FAQs
A py.test plugin that parses environment files before running tests
We found that pytest-dotenv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.