Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment not filled in on tests #334

Closed
antlong opened this issue Jun 19, 2017 · 5 comments
Closed

Environment not filled in on tests #334

antlong opened this issue Jun 19, 2017 · 5 comments

Comments

@antlong
Copy link

antlong commented Jun 19, 2017

In my test, I put:

import pytest
import allure

def pytest_configure(config):
allure.environment(url='site.com', browser=u'Google Chrome')

I ran the test, and environment was not filled in.

http://imgur.com/a/licky

@sseliverstov
Copy link
Contributor

Has it ever worked?
Try it with session scope fixture, may be allure is not ready on configuration stage.

@antlong
Copy link
Author

antlong commented Jul 10, 2017

I don't have the ability to dive in deeper.

@baev baev transferred this issue from allure-framework/allure-pytest Jan 14, 2019
@symonk
Copy link

symonk commented Feb 27, 2019

I will look into this, have a personal need for it. I would imagine there is NOTHING stopping you from creating your own environment.xml at runtime and dropping it into the allure results folder, as the command line generator should not care, its language agnostic (IIRC tho its been a while).

@symonk
Copy link

symonk commented Jun 4, 2019

    def _set_allure_environment(self) -> SomeObject:
        if 'allure-dir' in os.environ:
            with open(os.path.join(os.environ['allure-dir'], self._ENVIRONMENT_FILE), 'w+') as stream:
                stream.write('processes: {}\n'.format(os.getenv('processes')))
        else:
            log.info("No --allure-dir was specified so we are skipping the reporting properties")
        return self

here is a small snippet that makes it possible, as specified just drop the properties file into the allure-dir

@delatrie
Copy link
Contributor

delatrie commented Dec 6, 2022

Duplicate of #96

@delatrie delatrie marked this as a duplicate of #96 Dec 6, 2022
@delatrie delatrie closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants