class QTest

Synopsis

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

class TestFailMode
class ComparisonOperation

Added in version 6.4.

class QBenchmarkMetric

Added in version 4.7.

static addColumnInternal(id, name)
Parameters:
  • id – int

  • name – str

static asciiToKey(ascii)
Parameters:

ascii – int

Return type:

Key

static compare_ptr_helper(t1, t2, actual, expected, file, line)
Parameters:
  • t1QObject

  • t2QObject

  • actual – str

  • expected – str

  • file – str

  • line – int

Return type:

bool

static compare_ptr_helper(t1, t2, actual, expected, file, line)
Parameters:
  • t1void

  • t2void

  • actual – str

  • expected – str

  • file – str

  • line – int

Return type:

bool

static compare_string_helper(t1, t2, actual, expected, file, line)
Parameters:
  • t1 – str

  • t2 – str

  • actual – str

  • expected – str

  • file – str

  • line – int

Return type:

bool

static currentAppName()
Return type:

str

static currentDataTag()
Return type:

str

static currentTestFailed()
Return type:

bool

static currentTestFunction()
Return type:

str

static currentTestResolved()
Return type:

bool

static failOnWarning()
static failOnWarning(messagePattern)
Parameters:

messagePatternQRegularExpression

static failOnWarning(message)
Parameters:

message – str

static formatString(prefix, suffix, numArguments)
Parameters:
  • prefix – str

  • suffix – str

  • numArguments – int

Return type:

char

static ignoreMessage(type, messagePattern)
Parameters:
static ignoreMessage(type, message)
Parameters:
static keyToAscii(key)
Parameters:

keyKey

Return type:

int

static qCaught(expected, file, line)
Parameters:
  • expected – str

  • file – str

  • line – int

static qCaught(expected, what, file, line)
Parameters:
  • expected – str

  • what – str

  • file – str

  • line – int

static qCleanup()
static qElementData(elementName, metaTypeId)
Parameters:
  • elementName – str

  • metaTypeId – int

Return type:

void

static qExpectFail(dataIndex, comment, mode, file, line)
Parameters:
  • dataIndex – str

  • comment – str

  • modeTestFailMode

  • file – str

  • line – int

Return type:

bool

static qExtractTestData(dirName)
Parameters:

dirName – str

Return type:

QSharedPointer

static qFindTestData(basepath[, file=None[, line=0[, builddir=None[, sourcedir=None]]]])
Parameters:
  • basepath – str

  • file – str

  • line – int

  • builddir – str

  • sourcedir – str

Return type:

str

static qFindTestData(basepath[, file=None[, line=0[, builddir=None[, sourcedir=None]]]])
Parameters:
  • basepath – str

  • file – str

  • line – int

  • builddir – str

  • sourcedir – str

Return type:

str

static qGlobalData(tagName, typeId)
Parameters:
  • tagName – str

  • typeId – int

Return type:

void

static qRun()
Return type:

int

static qSkip(message, file, line)
Parameters:
  • message – str

  • file – str

  • line – int

static qSleep(ms)
Parameters:

ms – int

static qWait(ms)
Parameters:

ms – int

static runningTest()
Return type:

bool

static setBenchmarkResult(result, metric)
Parameters:
static setMainSourcePath(file[, builddir=None])
Parameters:
  • file – str

  • builddir – str

static setThrowOnFail(enable)
Parameters:

enable – bool

static setThrowOnSkip(enable)
Parameters:

enable – bool

static testObject()
Return type:

QObject

static toPrettyCString(unicode, length)
Parameters:
  • unicode – str

  • length – int

Return type:

char