小编joh*_*hnw的帖子

如何在类中键入一个类名

以下哪种语法是首选的或在法律上是正确的:

template< class T >
struct S
{
    typedef std::vector< S       > V;
//  typedef std::vector< S< T >  > V;
Run Code Online (Sandbox Code Playgroud)

Visual C++和gcc接受,但C++ Builder XE3在第一个上报告"E2299无法生成模板特化"错误.

c++

2
推荐指数
1
解决办法
200
查看次数

如何将值传递给Pytest装置

我正在使用Pytest测试可执行文件。该.exe文件在启动时读取配置文件。

我编写了一个夹具,以在每次测试开始时生成此.exe文件,并在测试结束时将其关闭。但是,我无法解决如何告诉灯具使用哪个配置文件的问题。我希望固定装置在生成.exe文件之前将指定的配置文件复制到目录中。

    @pytest.fixture
    def session(request):
        copy_config_file(specific_file) # how do I specify the file to use?
        link = spawn_exe()
        def fin():
            close_down_exe()
        return link 

    # needs to use config file foo.xml
    def test_1(session):  
        session.talk_to_exe()

    # needs to use config file bar.xml
    def test_2(session):
        session.talk_to_exe()
Run Code Online (Sandbox Code Playgroud)

我如何告诉灯具使用foo.xmltest_1功能和bar.xml用于test_2功能?

谢谢约翰

python automated-tests pytest

2
推荐指数
1
解决办法
574
查看次数

标签 统计

automated-tests ×1

c++ ×1

pytest ×1

python ×1