<commit_before>
import unittest

from PySide.QtGui import QPushButton
from helper import UsesQApplication

class QInputContextTest(UsesQApplication):

    def testSetFocusWidget(self):
        widget = QPushButton()
        widget.show()

        context = self.app.inputContext()
        self.assertEqual(context.focusWidget(), None)

        context.setFocusWidget(widget)
        self.assertEqual(context.focusWidget(), widget)


if __name__ == '__main__':
    unittest.main()
<commit_msg>Set WA_InputMethodEnabled in test.<commit_after>
import unittest

from PySide.QtCore import Qt
from PySide.QtGui import QPushButton
from helper import UsesQApplication

class QInputContextTest(UsesQApplication):

    def testSetFocusWidget(self):
        widget = QPushButton()
        widget.show()

        if not widget.testAttribute(Qt.WA_InputMethodEnabled):
            widget.setAttribute(Qt.WA_InputMethodEnabled)

        context = self.app.inputContext()
        self.assertEqual(context.focusWidget(), None)

        context.setFocusWidget(widget)
        self.assertEqual(context.focusWidget(), widget)


if __name__ == '__main__':
    unittest.main()

{'fraction_non_alphanumeric': 0.08910034602076125, 'fraction_numerical': 0.0, 'mean_word_length': 3.646586345381526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5811327', 'n_tokens_mistral': 329, 'n_tokens_neox': 320, 'n_words': 69}