Ideally the tests wouldn't touch the default data directory. Both the core unit tests and the functional tests do this correctly. However,  `src/qt/test/test_bitcoin-qt` seems to create an empty `~/.bitcoin` directory if it doesn't exist yet.
Instead, it should set up a temporary data directory like the other tests.
tableRPC.appendCommand("rpcNestedTest", &vRPCCommands[0]);
    ClearDatadirCache();
    std::string path = QDir::tempPath().toStdString() + "/" + strprintf("test_bitcoin_qt_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
    QDir dir(QString::fromStdString(path));
    dir.mkpath(".");
    gArgs.ForceSetArg("-datadir", path);
    
    TestingSetup test;
    SetRPCWarmupFinished();
    std::string result;
    std::string result2;
    std::string filtered;
    xecuteCommandLine(result, "getblockchaininfo()[chain]", &filtered); 
    QVERIFY(result=="main");
    QVERIFY(filtered == "getblockchaininfo()[chain]");
    xecuteCommandLine(result, "getblock(getbestblockhash())"); 
    xecuteCommandLine(result, "getblock(getblock(getbestblockhash())[hash], true)");
    xecuteCommandLine(result, "getblock( getblock( getblock(getbestblockhash())[hash] )[hash], true)"); 
    xecuteCommandLine(result, "getblockchaininfo");
    QVERIFY(result.substr(0,1) == "{");
    xecuteCommandLine(result, "getblockchaininfo()");
    QVERIFY(result.substr(0,1) == "{");
    xecuteCommandLine(result, "getblockchaininfo "); 
    QVERIFY(result.substr(0,1) == "{");
    (xecuteCommandLine(result, "getblockchaininfo()[\"chain\"]")); 
    QVERIFY(result == "null");
    (xecuteCommandLine(result, "createrawtransaction [] {} 0")); 
    (xecuteCommandLine(result2, "createrawtransaction([],{},0)")); 
    QVERIFY(result == result2);